#include "Reactor.hpp"
#include "Listener.hpp"

int main(int argc,char* argv[])
{
    if (argc != 2)
    {
        std::cout << "Use selectserver + port!" << std::endl;
        return 1;
    }
    uint16_t port = std::stoi(argv[1]);
    Reactor reactor;
    std::shared_ptr<Connection> listener = std::make_shared<Listener>(port);

    reactor.Init(); //先创建epoll模型再插入到内核当中
    reactor.InsertConnection(listener);
    reactor.Loop();
    return 0;
}